class NetIndex(object):
    def __init__(self):
        self._content = {}
        
    def Length(self):
        return len(self._content)
    
    def set(self,key,value):
        self._content[key] = value
        
    def get(self,key):
        if key in self._content.keys():
            return self._content[key]
        else:
            return False
        
    def insert(self,dict):
        for key in dict:
            self._content[key] = dict[key]
            
    def getlist(self,keyslist):
        result = [ self._content[key] for key in keyslist if key in self._content.keys()]
        return result
    
    def getdict(self,keyslist):
        result = {}
        for key in keyslist:
            if key in self._content.keys():
                result[key] = self._content[key]
        return result
    
    def getcontent(self,output="list"):
        if output == "list":
            return [self._content[key] for key in self._content.keys()]
        elif output == "dict":
            return self._content
        else:
            return []